using System;
using System.Collections.Generic;
using System.Linq;
using Ankha;
using Ankha.ContentPipeline;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using ScarletCore;
using ScarletCore.GameModes;
using ScarletCore.PipelineExtention;

namespace Scarlet
{
    public class Launcher : Microsoft.Xna.Framework.Game
    {
        //Fields
        public ScreenManager Manager { get; set; }
        
        //ctor
        public Launcher()
        {
            Manager = new ScreenManager(this);
            this.Window.Title = string.Format("{0} {1}", Globals.Title, Globals.Version);
        }

        //Methods
        protected override void Initialize()
        {
            //Add Pipelines
            Manager.ContentPipeline.AddPipeline(AssetLibrary.Instance);

            //Add Screens
            Manager.SetMenuScreen(new MainMenu());
            Manager.AddGameScreen(SurvivalMode.Key, new SurvivalMode());

            base.Initialize();
        }
        protected override void LoadContent()
        {
            FontLibrary.Instance.AddFont("Arial14");
            Manager.Load();
        }

        protected override void Update(GameTime gameTime)
        {
            Manager.Update(gameTime);

            base.Update(gameTime);
        }
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(new Color(44,0,168));

            Manager.Render(gameTime);

            base.Draw(gameTime);
        }
    }
}
